﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

using Phoenix.AppCode.Entities;
using Phoenix.AppCode.Data;
using System.Data;

namespace Phoenix.AppCode.Bussiness
{
    public class ContactService
    {
        public ContactService() 
        {
            //
            // TODO: Add constructor logic here
            //    
        }
        public static void Create(Contact contact)
        {
            ContactDAO contactDAO = new ContactDAO();
            contactDAO.Create(contact);
        }

        #region Backend Method
        /// <summary>
        /// Check mail Contact
        /// </summary>
        /// <param name="contact"></param>
        public static void Edit(Contact contact)
        {
            ContactDAO contactDAO = new ContactDAO();
            contactDAO.Edit(contact);
        }

        /// <summary>
        /// Delete
        /// </summary>
        /// <param name="contact"></param>
        public static void Delete(Contact contact)
        {
            ContactDAO contactDAO = new ContactDAO();
            contactDAO.Delete(contact);
        }

        /// <summary>
        /// Show all
        /// </summary>
        /// <param name="language"></param>
        /// <returns></returns>
        public static DataTable ContactList()
        {
            ContactDAO contactDAO = new ContactDAO();
            return contactDAO.ContactList();
        }

        /// <summary>
        /// Show data by ID
        /// </summary>
        /// <param name="idcontact"></param>
        /// <returns></returns>
        public static DataTable ContactList_GetByID(int idcontact)
        {
            ContactDAO contactDAO = new ContactDAO();
            return contactDAO.ContactList_GetByID(idcontact);
        }

        /// <summary>
        /// Get ID to edit or delete 
        /// </summary>
        /// <param name="idcontact"></param>
        /// <returns></returns>
        public static Contact GetContactByID(int idcontact)
        {
            ContactDAO contactDAO = new ContactDAO();
            return contactDAO.GetContactByID(idcontact);
        }
        #endregion
    }
}